package com.SunSoft.PhoneRemoteControl;

import android.app.AlertDialog.Builder;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Handler;
import android.os.Message;
import android.os.Vibrator;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.message.BasicNameValuePair;

final class cn
  implements View.OnClickListener
{
  public final void onClick(View paramView)
  {
    paramView = this.a.getResources().getResourceName(paramView.getId());
    int i = Integer.parseInt(paramView.substring(paramView.length() - 2));
    MainControl.a("Test", "but_id:" + String.valueOf(i));
    switch (i)
    {
    default:
      return;
    case 1:
      Toast.makeText(this.a, this.a.getString(2131099745), 0).show();
      paramView = new Message();
      paramView.what = 7;
      this.a.ca.sendMessage(paramView);
      return;
    case 2:
      this.a.d();
      return;
    case 3:
      paramView = new Intent(this.a, Show_help.class);
      paramView.putExtra("do_url", "3");
      this.a.startActivity(paramView);
      return;
    case 4:
      if (MainControl.d(this.a).a("is_rotray").equals("1"));
      for (paramView = this.a.getString(2131099697); ; paramView = this.a.getString(2131099696))
      {
        paramView = paramView + this.a.getString(2131099699);
        new AlertDialog.Builder(this.a).setTitle(MainControl.g(this.a)).setMessage(paramView).setNegativeButton(this.a.getString(2131099654), new co(this)).setPositiveButton(this.a.getString(2131099653), new cp(this)).show();
        return;
      }
    case 5:
      if (MainControl.d(this.a).a("is_vibrate").equals("1"))
      {
        MainControl.d(this.a).a("is_vibrate", "0");
        this.a.aL.setImageResource(2130837634);
      }
      while (true)
      {
        this.a.Q = MainControl.d(this.a).a("is_vibrate").equals("1");
        return;
        MainControl.d(this.a).a("is_vibrate", "1");
        this.a.aL.setImageResource(2130837635);
        ((Vibrator)this.a.getSystemService("vibrator")).vibrate(new long[] { 5L, 10L, 5L, 10L }, -1);
      }
    case 6:
      if (MainControl.b(this.a) > 0)
      {
        MainControl.a(this.a);
        if (MainControl.c(this.a))
        {
          Toast.makeText(this.a, this.a.getString(2131099861), 0).show();
          return;
        }
        Toast.makeText(this.a, this.a.getString(2131099860), 0).show();
        return;
      }
      this.a.e();
      return;
    case 7:
      this.a.aZ = true;
      this.a.bi = 1;
      paramView = new Message();
      paramView.what = 12;
      this.a.ca.sendMessage(paramView);
      return;
    case 8:
      this.a.aZ = true;
      this.a.bi = 2;
      paramView = new Message();
      paramView.what = 12;
      this.a.ca.sendMessage(paramView);
      return;
    case 9:
      this.a.f();
      return;
    case 0:
      paramView = new Intent();
      paramView.setAction("android.intent.action.SEND");
      paramView.putExtra("android.intent.extra.TEXT", this.a.getString(2131099868));
      paramView.setType("text/plain");
      this.a.startActivity(Intent.createChooser(paramView, this.a.getString(2131099867)));
      return;
    case 10:
      if (MainControl.d(this.a).a("is_mono").equals("1"))
      {
        MainControl.d(this.a).a("is_mono", "0");
        this.a.aM.setImageResource(2130837634);
        this.a.bz = this.a.d("start.tsg");
        MainControl.a(this.a, "", 1);
        MainControl.a(this.a);
        return;
      }
      MainControl.d(this.a).a("is_mono", "1");
      this.a.aM.setImageResource(2130837635);
      this.a.bz = this.a.d("sstart.tsg");
      MainControl.a(this.a, "", 1);
      MainControl.a(this.a);
      return;
    case 11:
      paramView = new Intent(this.a, Show_buy.class);
      this.a.startActivity(paramView);
      return;
    case 12:
      this.a.an = new ArrayList();
      this.a.an.add(new BasicNameValuePair("txtUser_name", "tasotest"));
      this.a.an.add(new BasicNameValuePair("txtPassword", "4321"));
      this.a.an.add(new BasicNameValuePair("action_value", "check"));
      this.a.bj = 19;
      this.a.ba = 13;
      this.a.bb = "http://www.tasogo.com/user_control.aspx";
      paramView = new Message();
      paramView.what = 5;
      this.a.ca.sendMessage(paramView);
      this.a.aZ = true;
      return;
    case 13:
      MainControl.a("Test", "is_handset_connected:" + String.valueOf(MyApplication.a().a));
      MainControl.a("Test", "is_soft_disconnect:" + String.valueOf(MyApplication.a().c));
      MainControl.a("Test", "is_hardware_disconnect:" + String.valueOf(MyApplication.a().e));
      MainControl.a("Test", "is_mul_disconnect:" + String.valueOf(MyApplication.a().f));
      MainControl.a("Test", "is_in_soft_disconnecting:" + String.valueOf(MyApplication.a().d));
      if (MyApplication.a().a)
      {
        MyApplication.a().f = true;
        MyApplication.a().a(false, this.a);
        MainControl.d(this.a).a("is_soft_disconnect", "1");
        paramView = new Message();
        paramView.what = 28;
        this.a.ca.sendMessage(paramView);
        return;
      }
      if ((!(MyApplication.a().e)) && (MyApplication.a().c))
      {
        MyApplication.a().f = false;
        MyApplication.a().a(true, this.a);
        paramView = new Message();
        paramView.what = 28;
        this.a.ca.sendMessage(paramView);
        return;
      }
      Toast.makeText(this.a, this.a.getString(2131099883), 0).show();
      return;
    case 14:
    }
    paramView = this.a;
    paramView.bH += 1;
    if (this.a.bH > 2)
      this.a.bH = 0;
    if (this.a.bH == 0)
      this.a.aO.setImageResource(2130837632);
    if (this.a.bH == 1)
      this.a.aO.setImageResource(2130837635);
    if (this.a.bH == 2)
      this.a.aO.setImageResource(2130837634);
    MainControl.d(this.a).a("download_type", String.valueOf(this.a.bH));
  }
}